1. Technical Field
The present invention relates in general to a method and system for data processing, and in particular to a data processing system and method for emulating a program. Still more particularly, the present invention relates to a data processing system and method which execute programs by emulation directly out of an emulated backing store to minimize emulation overhead.
2. Description of the Related Art
To minimize software development costs, it is often advantageous to make improvements to data processing system architecture backwards compatible, thereby enabling existing software to run on an enhanced data processing system with little or no modification. However, as technology advances, further enhancements of prior architectures are often inadequate to meet current performance requirements. In that case, new architectures are developed which utilize a different address space, addressing scheme, instruction set, etc., than prior architectures. Because of these architectural differences, software libraries utilized by prior architectures cannot be executed directly by a data processing system employing the new architecture, but can be executed only by emulation.
A typical emulator includes a number of instruction handler routines which each correspond to one instruction within the instruction set of the emulated architecture. To execute a program designed to execute within the emulated architecture, a data processing system maps selected aspects of the emulated architecture, for example, address space, virtual memory page size, and user registers, to corresponding resources within the data processing system and executes instruction handler routines corresponding to each instruction within the program.
Although emulation permits programs written for a prior architecture to be executed within a state-of-the-art data processing system, the processing overhead required to emulate a prior architecture can degrade the performance of a data processing system to such an extent that the software development costs saved by emulating existing software are insignificant compared with the performance penalty incurred. For example, in a typical emulation, the addressing scheme of the emulated architecture and the data processing system are different. Therefore, the address of each instruction and its associated operands must be translated before the instruction can be emulated. The translation overhead for operands is particularly high when emulating instructions such as "store multiple" which access numerous addresses. In addition, when emulating a data processing system which utilizes a virtual address space, the DASD and main store address spaces are typically simulated separately. Thus, when an emulated program requires a new page of virtual memory to be paged in, in addition to retrieving the required page from the backing store, the emulator must transfer the data residing within the virtual page from the simulated DASD to the simulated main store, as would be performed in hardware by the emulated system. Furthermore, during normal execution of a program, a processor typically prefetches instructions that are likely to be executed in order to minimize instruction latency. However, when emulating a system which supports reetrant programming, an instruction handler routine is typically fetched only after the completion of the instruction handler routine utilized to emulate the previous instruction. Fetching is serialized in this manner during emulation since the emulation of a program instruction could possibly modify the following program instruction, thereby changing which instruction handler routine should be fetched.
As is apparent from the foregoing description, it would be desirable to provide an improved data processing system and method which minimize the processing overhead required to emulate a second data processing system. In particular, it would be desirable to provide an improved method of storing, fetching, and executing emulated instructions within a data processing system.